import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../base/entity/base';

export enum DemandTeamRequestStatus {
  PENDING = 0,
  FOLLOWING = 1,
  COMPLETED = 2,
  CLOSED = 3,
}

@Entity('demand_team_request', { comment: '用户提交给服务团队的需求' })
export class DemandTeamRequestEntity extends BaseEntity {
  @Column({ comment: '提交用户ID', nullable: false })
  userId: number;

  @Column({ comment: '团队ID', nullable: false })
  teamId: number;

  @Column({ comment: '团队所有者服务人员ID', nullable: true })
  ownerProviderId?: number;

  @Column({ comment: '需求描述', type: 'text', nullable: false })
  description: string;

  @Column({ comment: '联系人姓名', length: 50 })
  contactName: string;

  @Column({ comment: '联系方式', length: 100 })
  contactInfo: string;

  @Column({
    comment: '状态',
    dict: ['待处理', '跟进中', '已完成', '已关闭'],
    default: DemandTeamRequestStatus.PENDING,
  })
  status: DemandTeamRequestStatus;

  @Column({ comment: '服务人员备注', nullable: true, length: 500 })
  providerRemark?: string;

  @Column({ comment: '最后操作服务人员ID', nullable: true })
  lastOperatorProviderId?: number;
}


